// 课程管理api
import request from '@/utils/request'
const api_name = '/eduservice/chapter/'

export default{
    // 根据课程id获取章节和小节
    getChapterVideoByCourseId(courseId){
        return request({
            url:`${api_name}/nestedList/${courseId}`,
            method:'get'
        })
    },

    removeById(id) {
        return request({
          url: `${api_name}/${id}`,
          method: 'delete'
        })
      },
    
      save(eduChapter) {
        return request({
          url: `${api_name}/save`,
          method: 'post',
          data: eduChapter
        })
      },
    
      getById(id) {
        return request({
          url: `${api_name}/${id}`,
          method: 'get'
        })
      },
    
      updateById(eduChapter) {
        return request({
          url: `${api_name}/${eduChapter.id}`,
          method: 'put',
          data: eduChapter
        })
      },
}